package net.comm.user.db;


import java.sql.ResultSet;
import java.sql.SQLException;

import net.comm.user.bean.BaseUserSet;
import net.comm.user.bean.BaseVistorLog;
import net.comm.util.StringUtil;

import org.sakaiproject.db.api.SqlReader;

public class DbVistorLogService implements SqlReader
{

	/**
	 * Read from the result one set of fields to create a Resource.
	 * 
	 * @param result
	 *        The Sql query result.
	 * @return The Resource object.
	 */
	public Object readSqlResultRecord(ResultSet result)
	{
		try
		{
			
			int  	seqID = result.getInt(1);			//	序号
			int  	userID = result.getInt(2);			//	会员ID
			int  	vistorID = result.getInt(3);			//	访问者ID
			String  mtime = StringUtil.getValue(result.getString(4));				//最后修改时间

			// create the Resource from these fields
			return new BaseVistorLog( seqID,  userID,  vistorID, mtime );
		}
		catch (SQLException e)
		{
			return null;
		}
		
	}
}
